
package za.ac.cput.peterjohn.DesignPatternPrincipals.creational.FactoryMethodPattern.Factory;

import za.ac.cput.peterjohn.DesignPatternPrincipals.creational.FactoryMethodPattern.Model.Animal;
import za.ac.cput.peterjohn.DesignPatternPrincipals.creational.FactoryMethodPattern.Model.Cat;
import za.ac.cput.peterjohn.DesignPatternPrincipals.creational.FactoryMethodPattern.Model.Dog;

public class AnimalFactory 
{
    private static  Animal animal = null;

    public static Animal getAnimal(String type) 
    {
        if("canine".equals(type))
            animal = new Dog();
        else
            animal = new Cat();
        
        return animal;
    } 
}